*{
    margin:0px;
    padding:0px;
}
.tab{
    width:300px;
    height:300px;
    overflow:hidden;
    margin:50px;
}
.tab>:first-child{
    display:table;
    content:"";
    clear:both;
}
.tab>:first-child>*{
    display:block;
    width:50px;
    height:30px;
    background:red;
    float:left;
    text-align:center;
    line-height:30px;
    color:white;
    margin-right:5px;
}
.tab>:last-child{
    color:blue;
}
.tab>:last-child>*{
    width:300px;
    height:300px;
    background:red;
    display:none
}
.tab>:last-child>:first-child{
    display:block;
}